<{capture name="header"}>
<{lang_script src="lang.js" app='b2c'}>
<{script src="coms/pager.js" app='desktop'}>
<{script src="coms/datapicker.js"  app='desktop'}>
<{/capture}>
<script>


    /* ***********************************************************************/


var goodsEditFrame = (function(){

 

    /******************************************/
        /*
         *  sign:{
               1:保存并增加相似商品,
               2:保存并返回,
               3:保存当前不返回，
         *    }
         */
   var _form=$('gEditor'),_formActionURL=_form.get('action');

   subShopinfoForm = function (event,sign){
        var _default_disabled_bn = false;
       $$('.class-bn').each(function(item,index){
          if($(item).get('disabled')) {
            _default_disabled_bn = true;
            $(item).set('disabled', false);
          }
       });



    switch (sign){
            case 1:
            
            var target={
                    onComplete:function(){
                        location.reload();
                         if( _default_disabled_bn ) {
                          $$('.class-bn').set('disabled', true);
                        }
                       
                }};
            break;
            case 2:
            var target={
                    onComplete:function(rs){
                        if(JSON.decode(rs).error) {
                            return ;
                        }
                        if(window.opener.finderGroup&&window.opener.finderGroup['<{$env.get.finder_id}>']){
                            window.opener.finderGroup['<{$env.get.finder_id}>'].refresh();
                        }
                        window.close();
                        if( _default_disabled_bn ) {
                          $$('.class-bn').set('disabled', true);
                        }

                    }};
            break;
            case 3:
            var target={           //保存当前
                    onComplete:function(rs){
                        var id = JSON.decode(rs).store_id;
                        if(id > 0){
                            $('newshopinfo-edit-form-GId-input').value =id;
                            $('gEditor-g-type').value ='edit';
                            if( _default_disabled_bn ) {
                            $$('.class-bn').set('disabled', true);
                                }
                          
                        }
                      
                    }};
            break;
       }

       _form.store('target',target);
       _form.fireEvent('submit',new Event(event));

   };
});

goodsEditFrame();

</script>

<form name="gEditor" id="gEditor" method='post'  action="index.php?app=business&ctl=admin_storeregion&act=toAdd">
<input name="__type" value="<{$storeregion.region_id ? 'edit' : 'add'}>" id="gEditor-g-type" type="hidden">
<div class="tableform">
    <div class="division">
    <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr><th style="width:10%;"><em class="red">*</em><{t}>经营范围：<{/t}></th>
        <input name="storeregion[region_id]" value="<{$storeregion.region_id}>" id="newshopinfo-edit-form-GId-input" type="hidden" value=$storeregion.region_id>
        <td><{input type="text" name="storeregion[region_name]" id="region_name" size="100" vtype="required" value=$storeregion.region_name}></td></tr>

      
        <tr><th style="width:10%;"><{t}>备注：<{/t}></th>
        <td> <{input  type='text' id=remark  name="storeregion[remark]" value=$storeregion.remark size="100"}></td></tr>
        </table>
    </div>

</div>
<{capture name="footbar"}>
<table cellspacing="0" cellpadding="0" class="table-action">
      <tbody>
        <tr valign="middle">
        <td>
            <{button label=$___b2c="保存并关闭窗口"|t:'b2c' class="btn-primary" onclick="subShopinfoForm(event,2)"}>
            <{if !$storeregion.region_id}>
            <{button label=$___b2c="保存并添加相似"|t:'b2c' class="btn-primary" onclick="subShopinfoForm(event,1)"}>
            <{/if}>
            <{button label=$___b2c="保存当前"|t:'b2c' class="btn-primary" onclick="subShopinfoForm(event,3)"}>
            <{assign var=bcclose value=$___b2c='确定退出?'|t:'b2c'}>
            <{assign var=bclose value="关  闭"}>
            <{button label=$___b2c=$bclose|t:'b2c' class="btn-secondary" onclick="if(confirm('{$bcclose}'))window.close()"}>
        </td>
        </tr>
        </tbody>
</table>
<{/capture}>
</form>





